write a java program to count number of digits